
export function formPromiseTool<R>(): {done: Promise<R>, resolve: (result:R) => void, reject: (reason?: any) => void}{
    let resolve: (result:R) => void = () => {
        console.error('resolve这个方法没有被覆写')
    };
    let reject: (reason?: any) => void = () => {
        console.error('reject这个方法没有被覆写')
    };

    const done = new Promise<R>((rs,rj) => {
        resolve = rs;
        reject = rj;
    });

    return {
        done,
        reject,
        resolve
    }
}



export type Nullable<V> = V | null;